//
//  SimpleVideoPlayer.h
//  SimpleVideoPlayer
//
//  Created by Handymood on 11-5-21.
//  Copyright 2011 __Hanydmood__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>
#include "ImageUIButton.h"
@class ImageUIButton;

#import "UIComponentBase.h"
@class UIComponentBase;

@interface SimpleVideoPlayer : UIComponentBase
{
    ImageUIButton *playBtn;
    UIButton *backgroundBtn;
    MPMoviePlayerController *mediaPlayer;
    BOOL isLoop;
    NSTimer *loadDetectTimer;
    
    BOOL isInBuffer;
    float    bufferTime;
    
    UIActivityIndicatorView *activityIndicator;
    
    //slideshow relevant information
    BOOL slideshowAutoPlay;
    
    int fade;
}

-(void)initVideoPlayer:(NSString *)inVideoPath
                   videoSize:(CGSize )inSize
                    autoPlay:(BOOL) inAutoPlay 
                      isLoop:(BOOL) inLoop
                      ratioMode:(int) inRatioMode
                     playerStyle:(int) inPlayerStyle
         slideshowAutoPlay:(BOOL) isSlideshowAutoPlay
                    slideBgmOn:(BOOL) isSlideBgmOn
                            inFade:(int) isFade;

-(void) playBtnMouseDownProc:(id)sender;
-(void) pauseBtnMouseDownProc:(id)sender;

-(void) playbackFinished:(NSNotification*) notification;
-(void) playLoadStateChanged:(NSNotification*) notification;

-(void) pauseVideoFunc;
-(void)resumeVideoFunc;

-(void) webLoadingDetect;

-(void)setXY:(CGFloat) inx 
        offy:(CGFloat) iny;

-(BOOL) mediaOnPlaying;
-(void) reset;

@end
